#include<iostream>
using namespace std;



int add(int x,int y){
    return x + y;
}

int sub(int x,int y){
    return x - y;
}

//函数指针
int (*f)(int x, int y);

int main(){
    f = &add;
    printf("1+2=%d \n", (*f)(1, 2));
    f = &sub;
    printf("1-2=%d \n", (*f)(1, 2));
    system("pause");
    return 1;
}